package com.youlai.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 *@Author shen chen
 *@Date 2024-04-01
 */

/**
 * 操作日志记录
 */
@Schema(description = "操作日志记录")
@Data
@TableName(value = "sys_oper_log")
public class SysOperLog implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "日志主键")
    private Long id;

    /**
     * @see com.youlai.system.common.enums.ModuleEnum
     */
    @TableField(value = "`module`")
    @Schema(description = "模块")
    private String module;

    @TableField(value = "title")
    @Schema(description = "标题")
    private String title;
    /**
     * @see com.youlai.system.common.enums.BusinessTypeEnum
     */
    @TableField(value = "business_type")
    @Schema(description = "业务类型")
    private String businessType;

    @TableField(value = "`method`")
    @Schema(description = "方法名称")
    private String method;

    @TableField(value = "request_method")
    @Schema(description = "请求方式")
    private String requestMethod;

    /**
     * @see com.youlai.system.common.enums.OperatorTypeEnum
     */
    @TableField(value = "operator_type")
    @Schema(description = "操作类别（0其它 1后台用户 2手机端用户）")
    private Integer operatorType;

    @TableField(value = "oper_name")
    @Schema(description = "操作人员")
    private String operName;

    @TableField(value = "dept_id")
    @Schema(description = "部门Id")
    private String deptId;

    @TableField(value = "oper_url")
    @Schema(description = "请求URL")
    private String operUrl;

    @TableField(value = "oper_ip")
    @Schema(description = "主机地址")
    private String operIp;

    @TableField(value = "oper_location")
    @Schema(description = "操作地点")
    private String operLocation;

    @TableField(value = "oper_param")
    @Schema(description = "请求参数")
    private String operParam;

    @TableField(value = "json_result")
    @Schema(description = "返回参数")
    private String jsonResult;

    @TableField(value = "`status`")
    @Schema(description = "操作状态（0正常 1异常）")
    private Integer status;

    @TableField(value = "error_msg")
    @Schema(description = "错误消息")
    private String errorMsg;

    @TableField(value = "oper_time")
    @Schema(description = "操作时间")
    private LocalDateTime operTime;

    @TableField(value = "cost_time")
    @Schema(description = "消耗时间")
    private Long costTime;

    private static final long serialVersionUID = 1L;
}